import axios from "@/api/request";
export const BASE_INFO = {
  operationName: "userPublicProfile",
  // variables: {
  //   userSlug: "showlotus",
  // },
  query:
    "query userPublicProfile($userSlug: String!) {\n  userProfilePublicProfile(userSlug: $userSlug) {\n    username\n    haveFollowed\n    isBlocked\n    siteRanking\n     submissionProgress {\n      totalSubmissions\n      waSubmissions\n      acSubmissions\n      reSubmissions\n      otherSubmissions\n      acTotal\n      questionTotal\n      __typename\n    }\n    __typename\n  }\n}\n",
};
export const SOLVE_QUESTIONS_INFO = {
  operationName: "userQuestionProgress",
  // variables: {
  //   userSlug: "showlotus",
  // },
  query:
    "query userQuestionProgress($userSlug: String!) {\n  userProfileUserQuestionProgress(userSlug: $userSlug) {\n    numAcceptedQuestions {\n      difficulty\n      count\n      __typename\n    }\n    numFailedQuestions {\n      difficulty\n      count\n      __typename\n    }\n    numUntouchedQuestions {\n      difficulty\n      count\n      __typename\n    }\n    __typename\n  }\n}\n",
};
export const getUserInfo = user =>
  axios.post("/leetcode", { ...BASE_INFO, variables: { userSlug: user } });
export const getSolvedQuestion = user =>
  axios.post("/leetcode", { ...SOLVE_QUESTIONS_INFO, variables: { userSlug: user } });
